package com.dolphin.servicedriveruser.controller;

import com.dolphin.common.dto.ResponseResult;
import com.dolphin.servicedriveruser.mapper.DriverUserMapper;
import com.dolphin.servicedriveruser.service.DriverUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Autowired
    private DriverUserService driverUserService;

    @Autowired
    DriverUserMapper driverUserMapper;

    @GetMapping("/test")
    public String test() {
        return "test";
    }

    @GetMapping("/test-db")
    public ResponseResult testDb() {

        return driverUserService.testGetDriverUser();

    }

    @GetMapping("/test-mapper")
    public int testMapper(@RequestParam String cityCode) {

        return driverUserMapper.selectDriverUserCountByCityCode(cityCode);

    }
}
